package com.bzkj.web.controller.basicInfo;


import com.bzkj.common.annotation.Log;
import com.bzkj.common.core.controller.BaseController;
import com.bzkj.common.core.domain.AjaxResult;
import com.bzkj.common.core.page.TableDataInfo;
import com.bzkj.common.enums.BusinessType;
import com.bzkj.msfx.domain.fileTransfer.ErpSharefolders;
import com.bzkj.msfx.service.fileTransfer.ErpSharefoldersService;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 共享文件夹配置Controller
 *
 * @author chj
 * @date 2024-01-08
 */
@RestController
@RequestMapping("/btrh/fileTransfer/ShareFolders")
public class ErpSharefoldersController extends BaseController {
    @Resource
    private ErpSharefoldersService erpSharefoldersService;

    /**
     * 查询共享文件夹配置列表
     */
    @PreAuthorize("@ss.hasPermi('fileTransfer:ShareFolders:list')")
    @GetMapping("/list")
    @ApiOperation("查询共享文件夹配置列表")
    public TableDataInfo list(ErpSharefolders erpSharefolders) {
        return erpSharefoldersService.selectErpSharefoldersList(erpSharefolders);
    }

    /**
     * 获取共享文件夹配置详细信息
     */
    @PreAuthorize("@ss.hasPermi('fileTransfer:ShareFolders:query')")
    @GetMapping(value = "/{id}")
    @ApiOperation("获取共享文件夹配置详细信息")
    public AjaxResult getInfo(@PathVariable("id") Long id) {
        return erpSharefoldersService.selectErpSharefoldersById(id);
    }

    /**
     * 新增共享文件夹配置
     */
    @PreAuthorize("@ss.hasPermi('fileTransfer:ShareFolders:add')")
    @Log(title = "共享文件夹配置", businessType = BusinessType.INSERT)
    @PostMapping
    @ApiOperation("新增共享文件夹配置")
    public AjaxResult add(@RequestBody ErpSharefolders erpSharefolders) {
        return erpSharefoldersService.insertErpSharefolders(erpSharefolders);
    }

    /**
     * 修改共享文件夹配置
     */
    @PreAuthorize("@ss.hasPermi('fileTransfer:ShareFolders:edit')")
    @Log(title = "共享文件夹配置", businessType = BusinessType.UPDATE)
    @ApiOperation("修改共享文件夹配置")
    @PutMapping
    public AjaxResult edit(@RequestBody ErpSharefolders erpSharefolders) {
        return erpSharefoldersService.updateErpSharefolders(erpSharefolders);
    }

    /**
     * 删除共享文件夹配置
     */
    @PreAuthorize("@ss.hasPermi('fileTransfer:ShareFolders:remove')")
    @Log(title = "共享文件夹配置", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    @ApiOperation("删除共享文件夹配置")
    public AjaxResult remove(@PathVariable Long ids) {
        return erpSharefoldersService.deleteErpSharefoldersByIds(ids);
    }
}
